# Maintainer: Jaroslav Lichtblau <svetlemodry@archlinux.org>
# Contributor: Mateusz Herych <heniekk@gmail.com>
# Contributor: dorphell <dorphell@archlinux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>
# Contributor: Chris Brannon <cmbrannon (at) cox.net>

pkgname=epic4
pkgver=2.10.10
pkgrel=5
pkgdesc="It's a new direction in ircII development"
arch=('loong64' 'x86_64')
url="http://www.epicsol.org/"
license=('custom')
depends=('openssl' 'ncurses' 'tcl' 'perl')
options=('!emptydirs')
source=(http://ftp.epicsol.org/pub/epic/EPIC4-PRODUCTION/$pkgname-$pkgver.tar.xz)
sha256sums=('d12271bcbfd827e9e759c32bba60ece805ae978d33ed91d9207de436d071fbc5')

build() {
 cd "${srcdir}"/$pkgname-$pkgver

#to avoid build fail
  unset CPPFLAGS

  CFLAGS+=' -fcommon' # https://wiki.gentoo.org/wiki/Gcc_10_porting_notes/fno_common

  ./configure --prefix=/usr \
       --mandir=/usr/share/man \
       --with-ssl \
       --with-ipv6 \
       --with-perl \
       --with-tcl
  make
}

package() {
  cd "${srcdir}"/$pkgname-$pkgver

  make prefix="${pkgdir}"/usr \
       libexecdir="${pkgdir}"/usr/bin \
       mandir="${pkgdir}"/usr/share/man install

#license
  install -Dm644 COPYRIGHT "${pkgdir}"/usr/share/licenses/$pkgname/COPYRIGHT
}
